home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / datatypes / wavdt / source / classbase.h < prev    next >
C/C++ Source or Header  |  1996-04-07  |  4KB  |  117 lines

  1. /******************************************************************************
  2.  *
  3.  * WAV Datatype, based on the sourcecode found in OS3.1 Native Developer Kit
  4.  *
  5.  * Written by David N.Junod and Christian Buchner
  6.  *
  7.  ******************************************************************************
  8.  * classbase.h
  9.  *
  10.  */
  11.  
  12. #include <dos/dos.h>
  13. #include <dos/dosextens.h>
  14. #include <exec/types.h>
  15. #include <exec/ports.h>
  16. #include <exec/memory.h>
  17. #include <exec/lists.h>
  18. #include <exec/devices.h>
  19. #include <exec/semaphores.h>
  20. #include <exec/execbase.h>
  21. #include <devices/audio.h>
  22. #include <intuition/classes.h>
  23. #include <intuition/classusr.h>
  24. #include <intuition/cghooks.h>
  25. #include <intuition/gadgetclass.h>
  26. #include <utility/tagitem.h>
  27. #include <datatypes/datatypes.h>
  28. #include <datatypes/datatypesclass.h>
  29. #include <datatypes/soundclass.h>
  30. #include <libraries/iffparse.h>
  31. #include <string.h>
  32. #include <dos.h>
  33.  
  34. #include <clib/macros.h>
  35. #include <clib/dos_protos.h>
  36. #include <clib/exec_protos.h>
  37. #include <clib/intuition_protos.h>
  38. #include <clib/utility_protos.h>
  39. #include <clib/datatypes_protos.h>
  40. #include <clib/dtclass_protos.h>
  41.  
  42. #include <pragmas/dos_pragmas.h>
  43. #include <pragmas/exec_pragmas.h>
  44. #include <pragmas/intuition_pragmas.h>
  45. #include <pragmas/utility_pragmas.h>
  46. #include <pragmas/datatypes_pragmas.h>
  47. #include <pragmas/dtclass_pragmas.h>
  48.  
  49. /*****************************************************************************/
  50.  
  51. #define    WAVDTCLASS        "wav.datatype"
  52.  
  53. /*****************************************************************************/
  54.  
  55. struct ClassBase
  56. {
  57.     struct Library         cb_Lib;
  58.  
  59.     struct ExecBase        *cb_SysBase;
  60.     struct Library        *cb_DOSBase;
  61.     struct Library        *cb_IntuitionBase;
  62.     struct Library        *cb_UtilityBase;
  63.     struct Library        *cb_DataTypesBase;
  64.     struct Library        *cb_SuperClassBase;
  65.     BPTR             cb_SegList;
  66.  
  67.     struct SignalSemaphore     cb_Lock;        /* Access lock */
  68.     Class            *cb_Class;
  69. };
  70.  
  71. /*****************************************************************************/
  72.  
  73. #define ASM            __asm
  74. #define REG(x)            register __ ## x
  75.  
  76. /*****************************************************************************/
  77.  
  78. #define SysBase            cb->cb_SysBase
  79. #define DOSBase            cb->cb_DOSBase
  80. #define UtilityBase        cb->cb_UtilityBase
  81. #define    IntuitionBase    cb->cb_IntuitionBase
  82. #define    DataTypesBase    cb->cb_DataTypesBase
  83. #define SuperClassBase    cb->cb_SuperClassBase
  84.  
  85. /*****************************************************************************/
  86.  
  87. ULONG __stdargs DoMethodA (Object *obj, Msg message);
  88. ULONG __stdargs DoMethod (Object *obj, unsigned long MethodID, ...);
  89. ULONG __stdargs DoSuperMethodA (struct IClass *cl, Object *obj, Msg message);
  90. ULONG __stdargs DoSuperMethod (struct IClass *cl, Object *obj, unsigned long MethodID, ...);
  91. ULONG __stdargs CoerceMethodA (struct IClass *cl, Object *obj, Msg message);
  92. ULONG __stdargs CoerceMethod (struct IClass *cl, Object *obj, unsigned long MethodID, ...);
  93. ULONG __stdargs SetSuperAttrs (struct IClass *cl, Object *obj, unsigned long Tag1, ...);
  94.  
  95. /*****************************************************************************/
  96.  
  97. /* classbase.c */
  98. Class *ASM ObtainWAVEngine ( REG (a6 )struct ClassBase *cb );
  99. struct Library *ASM LibInit ( REG (d0 )struct ClassBase *cb , REG (a0 )BPTR seglist , REG (a6 )struct Library *sysbase );
  100. LONG ASM LibOpen ( REG (a6 )struct ClassBase *cb );
  101. LONG ASM LibClose ( REG (a6 )struct ClassBase *cb );
  102. LONG ASM LibExpunge ( REG (a6 )struct ClassBase *cb );
  103.  
  104. /* dispatch.c */
  105. Class *initClass ( struct ClassBase *cb );
  106. ULONG ASM Dispatch ( REG (a0 )Class *cl , REG (a2 )Object *o , REG (a1 )Msg msg );
  107. BOOL ConvertObjectData ( struct ClassBase *cb , Class *cl , Object *o , struct TagItem *attrs );
  108. ULONG setdtattrs ( struct ClassBase *cb , Object *o , ULONG data , ...);
  109. ULONG getdtattrs ( struct ClassBase *cb , Object *o , ULONG data , ...);
  110. ULONG Get(struct ClassBase *cb, BPTR FH, UBYTE *buf, ULONG size, LONG *ErrorCode);
  111.  
  112. /* fastconvert.asm */
  113. extern void __asm ConvertMono8(register __a0 UBYTE *src, register __a1 UBYTE *dst, register __d0 ULONG len);
  114. extern void __asm ConvertStereo8(register __a0 UBYTE *src, register __a1 UBYTE *dst, register __d0 ULONG len);
  115. extern void __asm ConvertMono16(register __a0 UBYTE *src, register __a1 UBYTE *dst, register __d0 ULONG len);
  116. extern void __asm ConvertStereo16(register __a0 UBYTE *src, register __a1 UBYTE *dst, register __d0 ULONG len);
  117.